package com.dom4j;

import java.util.Iterator;

import org.dom4j.Element;

public class SJH {
	//读写xml类的父类，为它们提供了，根据手机号，查找xml里面的信息。
	public static Element zxSJH(String num,Element root) {
		Iterator it = root.elementIterator();
		while (it.hasNext()) {
			Element element = (Element) it.next();
			String b = element.attributeValue("num");
			if (num.equals(b)) {
				return element;
			}
		}
		return null;
	}
	public static  boolean bdSJH(String a,Element root) {
		Iterator it = root.elementIterator();
		while (it.hasNext()) {
			Element element = (Element) it.next();
			String b = element.attributeValue("num");
			if (a.equals(b)) {
				return false;
			}
		}
		return true;
	}
}
